import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css'
})
export class AppComponent {
  title = 'exam1';
  list = [
    {
      name: '新年美装低价钜献',
      price: '29',
      img: 'assets/images/p(7).jpeg',
    },
    {
      name: '美邦轻薄羽绒服',
      price: '189',
      img: 'assets/images/p(1).jpeg',
    },
    {
      name: '韩版中长款棉衣',
      price: '219',
      img: 'assets/images/p(2).jpeg',
    },
    {
      name: '丝绒半身裙',
      price: '128',
      img: 'assets/images/p(3).jpeg',
    },
    {
      name: '高领长款毛衣',
      price: '158',
      img: 'assets/images/p(4).jpeg',
    },
    {
      name: '达芙妮显瘦高筒靴',
      price: '159',
      img: 'assets/images/p(5).jpeg',
    },
    {
      name: '加绒长款卫衣',
      price: '181',
      img: 'assets/images/p(6).jpeg',
    },
  ]
  more(index:number){
    this.list.splice(index,1)
  }
  getLastDayOfFebruary() {
    let currentDate = new Date();
    let currentYear = currentDate.getFullYear();
    let currentMonth = currentDate.getMonth();
    
    let result = [];
    
    for (let i = 0; i < 6; i++) {
      let year = currentYear - i;
      
      let lastDayOfMonth = new Date(year, 2, 0);
      result.push(`${year}-02-${lastDayOfMonth.getDate()}`);
    }
    
    return result;
  }
}
